package com.cqie.hospitalescort.controller;

import com.cqie.hospitalescort.VO.AssessInfoVO;
import com.cqie.hospitalescort.entity.AssessInfo;
import com.cqie.hospitalescort.model.Result;
import com.cqie.hospitalescort.service.AssessInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 评价信息 前端控制器
 * </p>
 *
 * @author gdy
 * @since 2025-02-18
 */
@RestController
@RequestMapping("/assessInfo")
@Api(value = "评论管理", tags = {"评论管理"})
public class AssessInfoController extends BaseController {
    @Autowired
    private AssessInfoService assessInfoService;

    @GetMapping("/list")
    @ApiOperation(value = "评论列表")
    public Result<List<AssessInfoVO>> getAssessInfo(@RequestParam Long escortId) {
        return response(assessInfoService.getAssessInfo(escortId));
    }

    @PostMapping("/save")
    @ApiOperation(value = "发布评论")
    public Result<Void> saveAssessInfo(@RequestBody AssessInfo assessInfo) {
        assessInfoService.saveAssessInfo(assessInfo);
        return response();
    }

    @DeleteMapping("/delete")
    @ApiOperation(value = "删除评论")
    public Result<Void> deleteAssessInfo(@RequestParam Long id) {
        assessInfoService.deleteAssessInfo(id);
        return response();
    }

}
